package borge.web.teamspirit.client.data;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import borge.web.teamspirit.client.interfaces.PersistentData;

/**
 * 
 * Representation of a sport, like Soccer or hockey.
 * @author Andreas Borglin
 *
 *
 * LUGI
 * Innefotboll
 * HT09 2b
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Sport implements PersistentData{

	public static final String TYPE_NONE = "";
	public static final String TYPE_OUTDOOR = "Outdoor";
	public static final String TYPE_INDOOR = "Indoor";
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String iEncodedKey;

	@Persistent
	private String iName;
	
	@Persistent
	private String iType;
	
	@Persistent
	private Integer iNumPlayers;
	
	@Persistent
	private Integer iNumSubstitutes;
	
	
	public String toString(){
		return iName;
	}
	//public class 
	public Sport(){
		iName = "Soccer";
	//	iWhatever = new Integer(12);
	}
	
	public String getEncodedKey(){
		return iEncodedKey;
	}
	
	public void setName(String aName){
		iName = aName;
	}
	
	public String getName(){
		return iName;
	}
	
	@Override
	public String getDisplayingWidget() {
		// TODO Auto-generated method stub
		return null;
	}

}
